var type = {
	
};

$(".aui-grid-row-item").on("click",function(){
	var courseGrade = $(this).attr("data-id");
	window.location.href = "course_list.html?courseGrade={0}".format(courseGrade);
});

$(document).on("click",".n-tabItem a",function(){
	$(".n-tabItem a").removeClass("current");
	$(this).addClass("current");
});


//查询课程类别
type.list = function(){
	var ajax = new $ax(Feng.ctxPath+"/classType/getAllClassType", function(data){
        Feng.log("课程类型查询成功");
        var obj = data.obj || [];
        if (obj.length>0){        
        	

            var outHtml = template("dataTmpl",data.obj);
            $(".n-tabContainer").html(outHtml);
        }
    },function(data){
        Feng.error("课程类型查询失败!");
    });
    ajax.start();
};

$(function(){

    $("a[name='classSearch']").click(function (event) {
        var courseClass =$(this.children[1]).html();
        if(courseClass=="研学旅行"){
            window.location.href = "course_list.html?courseClass=2";
        }else if(courseClass=="冬夏令营"){
            window.location.href = "course_list.html?courseClass=3";
        }else if(courseClass=="线上辅导"){
            window.location.href = "course_list.html?courseClass=4";
        }
    })
});
